package com.example.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * Copyright © 2016年 author. All rights reserved.
 *
 * @Author 临江仙 hzqiuxm@163.com
 * @Date 2017/9/2 0002 20:52
 * 多线程调用的异步执行类，通过Async注解表示异步类或异步方法
 */
@Service
public class AsyncTaskService {

    @Async
    public void exectureAsuncTask(Integer i){

        System.out.println("执行异步任务：" + i);

    }

    @Async
    public void exectureAsyncTaskPlus(Integer i){
        System.out.println("执行异步任务+1" + (i+1));
    }

}
